package com.inspinia.base.common.model;

/**
 * 用户在线状态
 * Created by veblen on 2016/12/27.
 */
public enum UserLineStatus implements NameCodeEnum {
    online(1, "在线"),
    offline(2, "离线");

    private final int code;
    private final String name;

    UserLineStatus(int code, String name) {
        this.code = code;
        this.name = name;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getName() {
        return this.name;
    }

    public static UserLineStatus valueOf(int code) {
        for (UserLineStatus rs : UserLineStatus.values()) {
            if (rs.getCode() == code) {
                return rs;
            }
        }
        return null;
    }


}
